<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding: 0;}
        /* .box{
            width: 200px;
            height: 200px;
            background: aqua;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-left: -100px;
            margin-top: -100px;
        } */
        /* .box{
            width: 200px;
            height: 200px;
            background-color: blue;
            position: absolute;
            left: 50%;
            top: 50%;
            margin-left: -100px;
            margin-top: -100px;
        } */
        /* .box{
            width: 200px;
            height: 200px;
            background-color: red;
            position: absolute;
            top: 0px;
            bottom: 0px;
            left: 0px;
            right: 0px;
            margin: auto;
        } */
        .box{
            width: 200px;
            height: 200px;
            background-color: rgb(0, 255, 55);
            position: absolute;
            top: 0px;
            bottom: 0px;
            left: 0px;
            right: 0px;
            margin: auto
        }
    </style>
</head>
<body>
    
    <!-- 一个200*200的div在不同的分辨率屏幕上下左右居中，用css实现 -->
    <div class="box"></div>
</body>
</html>